<template>
  <div>
    <div class="recommand-title">热销推荐</div>
    <ul>
      <router-link class="item"
          v-for="item of list"
          :key="item.id"
          tag="li"
          :to="'/detail/' + item.id "
      >
        <img class="item-img" :src=item.imgUrl />
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <a class="item-btn" href="#">查看详情</a>
        </div>
      </router-link >
    </ul>
  </div>
</template>

<script>
export default{
  name: 'HomeRecommand',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped="scoped">
  @import '../../../assets/stylus/mixins.styl'
  .recommand-title
    margin-top: .2rem
    line-height: .8rem
    background-color: #eee
    text-indent: .2rem
    text-align: left
  .item
    display: flex
    height: 1.9rem
    overflow: hidden
    text-align: left
    border-bottom: 1px solid #ddd
    .item-img
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
    .item-info
      flex: 1
      padding: .2rem .1rem .2rem .24rem
      min-width: 0
      .item-title
        font-size: .42rem
        line-height: .64rem
        ellipsis()
      .item-desc
        line-height: .48rem
        color: #aaa
        ellipsis()
      .item-btn
        line-height: .52rem

</style>
